﻿using System;
using System.Web.Services;
using System.Diagnostics;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Xml.Serialization;
using com.huawei.esdk.tp.professional.DataType;

namespace com.huawei.esdk.tp.professional.eSDKTPProfessionalTerminalConfCtr
{
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name = "TPProfessionalTerminalConfCtrServiceSoapBinding", Namespace = "http://smc.huawei.com/")]
    public partial class TPProfessionalTerminalConfCtrService : System.Web.Services.Protocols.SoapHttpClientProtocol
    {

        private System.Threading.SendOrPostCallback requestChairExOperationCompleted;

        private System.Threading.SendOrPostCallback releaseChairExOperationCompleted;

        private System.Threading.SendOrPostCallback setRecordBroadExOperationCompleted;

        private System.Threading.SendOrPostCallback setDirectBroadExOperationCompleted;

        private System.Threading.SendOrPostCallback queryBroadInfoExOperationCompleted;

        private System.Threading.SendOrPostCallback queryConfCtrlPwdExOperationCompleted;

        //private bool useDefaultCredentialsSetExplicitly;

        /// <remarks/>
        public TPProfessionalTerminalConfCtrService()
        {
            //this.Url = global::esdk_tp_native_professional_cs.Properties.Settings.Default.esdk_tp_native_professional_cs_tpProfessionalConfCtrl_TPProfessionalConfCtrService;
            //if ((this.IsLocalFileSystemWebService(this.Url) == true))
            //{
            //    this.UseDefaultCredentials = true;
            //    this.useDefaultCredentialsSetExplicitly = false;
            //}
            //else
            //{
            //    this.useDefaultCredentialsSetExplicitly = true;
            //}
            this.Url = "http://localhost:8080/";
        }

        public TPProfessionalTerminalConfCtrService(string url)
        {
            this.Url = url;
        }

        /// <remarks/>
        public event requestChairExCompletedEventHandler requestChairExCompleted;

        /// <remarks/>
        public event releaseChairExCompletedEventHandler releaseChairExCompleted;

        /// <remarks/>
        public event setRecordBroadExCompletedEventHandler setRecordBroadExCompleted;

        /// <remarks/>
        public event setDirectBroadExCompletedEventHandler setDirectBroadExCompleted;

        /// <remarks/>
        public event queryBroadInfoExCompletedEventHandler queryBroadInfoExCompleted;

        /// <remarks/>
        public event queryConfCtrlPwdExCompletedEventHandler queryConfCtrlPwdExCompleted;

        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smc.huawei.com/requestChairEx", RequestNamespace = "http://smc.huawei.com/", ResponseNamespace = "http://smc.huawei.com/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("resultCode", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int requestChairEx([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string siteUri)
        {
            object[] results = this.Invoke("requestChairEx", new object[] {
                        siteUri});
            return ((int)(results[0]));
        }

        /// <remarks/>
        public void requestChairExAsync(string siteUri)
        {
            this.requestChairExAsync(siteUri, null);
        }

        /// <remarks/>
        public void requestChairExAsync(string siteUri, object userState)
        {
            if ((this.requestChairExOperationCompleted == null))
            {
                this.requestChairExOperationCompleted = new System.Threading.SendOrPostCallback(this.OnrequestChairExOperationCompleted);
            }
            this.InvokeAsync("requestChairEx", new object[] {
                        siteUri}, this.requestChairExOperationCompleted, userState);
        }

        private void OnrequestChairExOperationCompleted(object arg)
        {
            if ((this.requestChairExCompleted != null))
            {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.requestChairExCompleted(this, new requestChairExCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }

        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smc.huawei.com/releaseChairEx", RequestNamespace = "http://smc.huawei.com/", ResponseNamespace = "http://smc.huawei.com/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("resultCode", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int releaseChairEx([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string siteUri)
        {
            object[] results = this.Invoke("releaseChairEx", new object[] {
                        siteUri});
            return ((int)(results[0]));
        }

        /// <remarks/>
        public void releaseChairExAsync(string siteUri)
        {
            this.releaseChairExAsync(siteUri, null);
        }

        /// <remarks/>
        public void releaseChairExAsync(string siteUri, object userState)
        {
            if ((this.releaseChairExOperationCompleted == null))
            {
                this.releaseChairExOperationCompleted = new System.Threading.SendOrPostCallback(this.OnreleaseChairExOperationCompleted);
            }
            this.InvokeAsync("releaseChairEx", new object[] {
                        siteUri}, this.releaseChairExOperationCompleted, userState);
        }

        private void OnreleaseChairExOperationCompleted(object arg)
        {
            if ((this.releaseChairExCompleted != null))
            {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.releaseChairExCompleted(this, new releaseChairExCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }

        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smc.huawei.com/setRecordBroadEx", RequestNamespace = "http://smc.huawei.com/", ResponseNamespace = "http://smc.huawei.com/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("resultCode", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int setRecordBroadEx([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string siteUri, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] int action)
        {
            object[] results = this.Invoke("setRecordBroadEx", new object[] {
                        siteUri,
                        action});
            return ((int)(results[0]));
        }

        /// <remarks/>
        public void setRecordBroadExAsync(string siteUri, int action)
        {
            this.setRecordBroadExAsync(siteUri, action, null);
        }

        /// <remarks/>
        public void setRecordBroadExAsync(string siteUri, int action, object userState)
        {
            if ((this.setRecordBroadExOperationCompleted == null))
            {
                this.setRecordBroadExOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsetRecordBroadExOperationCompleted);
            }
            this.InvokeAsync("setRecordBroadEx", new object[] {
                        siteUri,
                        action}, this.setRecordBroadExOperationCompleted, userState);
        }

        private void OnsetRecordBroadExOperationCompleted(object arg)
        {
            if ((this.setRecordBroadExCompleted != null))
            {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.setRecordBroadExCompleted(this, new setRecordBroadExCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }

        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smc.huawei.com/setDirectBroadEx", RequestNamespace = "http://smc.huawei.com/", ResponseNamespace = "http://smc.huawei.com/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("resultCode", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int setDirectBroadEx([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string siteUri, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] int action)
        {
            object[] results = this.Invoke("setDirectBroadEx", new object[] {
                        siteUri,
                        action});
            return ((int)(results[0]));
        }

        /// <remarks/>
        public void setDirectBroadExAsync(string siteUri, int action)
        {
            this.setDirectBroadExAsync(siteUri, action, null);
        }

        /// <remarks/>
        public void setDirectBroadExAsync(string siteUri, int action, object userState)
        {
            if ((this.setDirectBroadExOperationCompleted == null))
            {
                this.setDirectBroadExOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsetDirectBroadExOperationCompleted);
            }
            this.InvokeAsync("setDirectBroadEx", new object[] {
                        siteUri,
                        action}, this.setDirectBroadExOperationCompleted, userState);
        }

        private void OnsetDirectBroadExOperationCompleted(object arg)
        {
            if ((this.setDirectBroadExCompleted != null))
            {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.setDirectBroadExCompleted(this, new setDirectBroadExCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }

        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smc.huawei.com/queryBroadInfoEx", RequestNamespace = "http://smc.huawei.com/", ResponseNamespace = "http://smc.huawei.com/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("resultCode", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int queryBroadInfoEx([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string siteUri, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] out BroadInfoEx broadInfo)
        {
            object[] results = this.Invoke("queryBroadInfoEx", new object[] {
                        siteUri});
            broadInfo = ((BroadInfoEx)(results[1]));
            return ((int)(results[0]));
        }

        /// <remarks/>
        public void queryBroadInfoExAsync(string siteUri)
        {
            this.queryBroadInfoExAsync(siteUri, null);
        }

        /// <remarks/>
        public void queryBroadInfoExAsync(string siteUri, object userState)
        {
            if ((this.queryBroadInfoExOperationCompleted == null))
            {
                this.queryBroadInfoExOperationCompleted = new System.Threading.SendOrPostCallback(this.OnqueryBroadInfoExOperationCompleted);
            }
            this.InvokeAsync("queryBroadInfoEx", new object[] {
                        siteUri}, this.queryBroadInfoExOperationCompleted, userState);
        }

        private void OnqueryBroadInfoExOperationCompleted(object arg)
        {
            if ((this.queryBroadInfoExCompleted != null))
            {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.queryBroadInfoExCompleted(this, new queryBroadInfoExCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }

        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smc.huawei.com/queryConfCtrlPwdEx", RequestNamespace = "http://smc.huawei.com/", ResponseNamespace = "http://smc.huawei.com/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("resultCode", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int queryConfCtrlPwdEx([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string siteUri, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] out string result)
        {
            object[] results = this.Invoke("queryConfCtrlPwdEx", new object[] {
                        siteUri});
            result = ((string)(results[1]));
            return ((int)(results[0]));
        }

        /// <remarks/>
        public void queryConfCtrlPwdExAsync(string siteUri)
        {
            this.queryConfCtrlPwdExAsync(siteUri, null);
        }

        /// <remarks/>
        public void queryConfCtrlPwdExAsync(string siteUri, object userState)
        {
            if ((this.queryConfCtrlPwdExOperationCompleted == null))
            {
                this.queryConfCtrlPwdExOperationCompleted = new System.Threading.SendOrPostCallback(this.OnqueryConfCtrlPwdExOperationCompleted);
            }
            this.InvokeAsync("queryConfCtrlPwdEx", new object[] {
                        siteUri}, this.queryConfCtrlPwdExOperationCompleted, userState);
        }

        private void OnqueryConfCtrlPwdExOperationCompleted(object arg)
        {
            if ((this.queryConfCtrlPwdExCompleted != null))
            {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.queryConfCtrlPwdExCompleted(this, new queryConfCtrlPwdExCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }

        /// <remarks/>
        public new void CancelAsync(object userState)
        {
            base.CancelAsync(userState);
        }

        private bool IsLocalFileSystemWebService(string url)
        {
            if (((url == null)
                        || (url == string.Empty)))
            {
                return false;
            }
            System.Uri wsUri = new System.Uri(url);
            if (((wsUri.Port >= 1024)
                        && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0)))
            {
                return true;
            }
            return false;
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void requestChairExCompletedEventHandler(object sender, requestChairExCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class requestChairExCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        internal requestChairExCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        /// <remarks/>
        public int Result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((int)(this.results[0]));
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void releaseChairExCompletedEventHandler(object sender, releaseChairExCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class releaseChairExCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        internal releaseChairExCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        /// <remarks/>
        public int Result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((int)(this.results[0]));
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void setRecordBroadExCompletedEventHandler(object sender, setRecordBroadExCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class setRecordBroadExCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        internal setRecordBroadExCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        /// <remarks/>
        public int Result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((int)(this.results[0]));
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void setDirectBroadExCompletedEventHandler(object sender, setDirectBroadExCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class setDirectBroadExCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        internal setDirectBroadExCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        /// <remarks/>
        public int Result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((int)(this.results[0]));
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void queryBroadInfoExCompletedEventHandler(object sender, queryBroadInfoExCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class queryBroadInfoExCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        internal queryBroadInfoExCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        /// <remarks/>
        public int Result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((int)(this.results[0]));
            }
        }

        /// <remarks/>
        public BroadInfoEx broadInfo
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((BroadInfoEx)(this.results[1]));
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    public delegate void queryConfCtrlPwdExCompletedEventHandler(object sender, queryConfCtrlPwdExCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.1")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class queryConfCtrlPwdExCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        internal queryConfCtrlPwdExCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        /// <remarks/>
        public int Result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((int)(this.results[0]));
            }
        }

        /// <remarks/>
        public string result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[1]));
            }
        }
    }
}
